package com.liuche.framework.common.constant;

public class CommonRedisKey {
    /**
     * 用户角色数据 KEY 前缀
     */
    private static final String USER_ROLES_KEY_PREFIX = "book:user:roles:";
    /**
     * 构建用户权限集合 key
     */
    private static final String ROLE_PERMISSIONS_KEY_PREFIX = "book:user:permissions:";
    /**
     * 构建验证码 KEY
     * @param userId
     * @return
     */
    public static String buildUserRoleKey(Long userId) {
        return USER_ROLES_KEY_PREFIX + userId;
    }
    /**
     * 构建角色对应的权限集合 KEY
     * @param roleKey
     * @return
     */
    public static String buildRolePermissionsKey(String roleKey) {
        return ROLE_PERMISSIONS_KEY_PREFIX + roleKey;
    }
}
